﻿<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<script src="<{$Think.const.MY_CONST_VAL}>Admin/js/jquery-3.1.0.min.js"></script>

<link rel="stylesheet" type="text/css" href="<{$Think.const.MY_CONST_VAL}>Admin/js/jqueryui/jquery-ui.min.css" />

<script src="<{$Think.const.MY_CONST_VAL}>Admin/js/jqueryui/jquery-ui.min.js"></script>
<link type="text/css" rel="stylesheet" href="<{$Think.const.MY_CONST_VAL}>Admin/css/H-ui.css"/>
<link type="text/css" rel="stylesheet" href="<{$Think.const.MY_CONST_VAL}>Admin/css/H-ui.admin.css"/>
<link type="text/css" rel="stylesheet" href="<{$Think.const.MY_CONST_VAL}>Admin/css/font-awesome.min.css"/>

<title>管理员列表</title>
<style>
	.msg{background-color:#ccffff;padding:20px;width:200px;position:absolute;left:50%;margin-left:-100px;display:none;}

	.confirm{background-color:#ccffff;padding:20px;width:200px;position:absolute;left:50%;margin-left:-100px;top:50px;display:none;}

	.v-edit{background-color:#99ff66;padding:20px;width:300px;position:absolute;left:50%;margin-left:-150px;top:50px;display:none;}

</style>
</head>
<body>

<div class="msg">hello</div>
<form class="v-edit" action="">
<table >
	<tr >
		<td>Id</td>
		<td><input type="text" value="1" name="uid"></td>
	</tr>
	<tr >
		<td>职位名</td>
		<td><input name="uname" type="text" value=""></td>
	</tr>
	<volist name="info1" id="vo" >
		<tr >
		<td><{$vo['name']}></td>
		<td></td>
	</tr>
	<foreach name="data1" item="v" >
	 <eq name="v.fid" value="$vo['id']">
		<tr class="text-c">
		<td></td>
		<td><input type="checkbox" name="zquan[]" value="<{$v['id']}>"/><{$v['name']}></td>
	</tr>
	</eq>
	</foreach>
	
	</volist>
	
  </table>
	<input type="button" value="修改">
	<input type="button" value="取消"><br>
</form>
<div class="pd-20">
  <div class="text-c"><a href="<{:U('zwadd')}>"> <span type="button" class="btn btn-success" 
> 添加职位</span></a>
 
  </div>
  <div class="cl pd-5 bg-1 bk-gray mt-20">
    <span class="l"><a href="javascript:;" onClick="datadel()" class="btn btn-danger radius"><i class="icon-trash"></i> 批量删除</a></span>
    <span class="r">共有数据：<strong>54</strong> 条</span>
  </div>
  <table class="table table-border table-bordered table-bg">
    <thead>
      <tr>
        <th scope="col" colspan="7">权限节点</th>
      </tr>
      <tr class="text-c">
        <th width="25"><input type="checkbox" name="" value=""></th>
        <th width="40">ID</th>
        <th width="200">职位名称</th>
        <th>权限</th>
        <th width="70">操作</th>
      </tr>
    </thead>
    <tbody>
    
    <volist name="info" id="vo" >
      <tr  id="user_<{$vo['zid']}>" class="text-c">
        <td><input type="checkbox" value="<{$vo['zid']}>" name=""></td>
        <td><{$vo['zid']}></td>
        <td><{$vo['zname']}></td>
        <td>
              <foreach name="data" item="v" >
	

	<in name="v.id" value="$vo['zquan']">
	<{$v['name']}>/
	</in>

	  </foreach>
        
        
        </td>
        <td class="f-14">
<a title="编辑" href="<{:U('zwedit')}>?id=<{$vo['zid']}>"  data-uid="<{$vo['zid']}>" class="ml-5" style="text-decoration:none"><i class="icon-edit"></i></a>
<a title="删除" name="del" data-uid="<{$vo['zid']}>" class="ml-5" style="text-decoration:none"><i class="icon-trash"></i></a></td>
      </tr>
     	</volist> 
    </tbody>
  </table>
</div>
	<script>
//全选反选

	$(function(){

		  //自动完成
		  $( "#birds" ).autocomplete({
		    source: "<{:U('search')}>",
		  });
		
		//
		$('#s_all').click(function(){
			$('.c1').prop('checked',$(this).prop('checked'));	
		});
		
		$('#f_all').click(function(){
			$('.c1').map(function(k,v){
				var flag = $(v).prop('checked');
				$(v).prop('checked',!flag);
			});			
		});
		
		//
		$('[name="del"]').click(function(){
			var uid = $(this).attr('data-uid');
			$("<div>删除将无法恢复</div>").dialog({
				title:'确定删除吗',
				modal: true,
				buttons: {
			        "确定删除": function() {	
			        	$.get('<{:U("zwdel")}>',{uid:uid},function(data){
			    			if(data.status){				
			    				$('#user_'+uid).remove();
			    				$('.msg').text(data.msg);
			    				$('.msg').slideDown('fast');
			    				setTimeout(function(){$('.msg').slideUp('fast');},1000);				
			    			}else{
			    				$('#user_'+uid+' [name="del"]').val('删除');
			    				
			    				$('.msg').text(data.msg);
			    				$('.msg').slideDown('fast');
			    				setTimeout(function(){$('.msg').slideUp('fast');},1000);
			    			}			
			    		},'json');
			        		   	
			          $( this ).dialog( "close" );
			        },
			        "取消": function() {
				          $( this ).dialog( "close" );
				        },
				},     
			});		
		});
		
		
			
			

		
		
	
});



	</script>
	



</body>
</html>